import {Component, Input} from '@angular/core';
import {MediaPlugin} from "ionic-native";
import {CommentType} from "../reply-input/comment-type";

export class ReplyModel {

  public get content()
  {
    if (this.commentType == CommentType.VoiceComment)
    {
      return `Voice Message: ${this.additionContent}"`;
    }
    return this._content;
  }
  public set content(v)
  {
    this._content = v;
  }

  constructor(
              public id: number,
              private _content: string,
              public author: string,
              public author_uid: number,
              public date: Date,
              public comment_reply_uid: number,
              public comment_reply_username: string,
              public commentType: CommentType = CommentType.TextComment,
              public additionContent: string = ''
  ) {
  }

  playAudio() {

  }
}

@Component({
  selector: 'reply-list',
  templateUrl: 'reply-list.html'
})
export class ReplyList {

  @Input()
  replies: Array<ReplyModel>;

  constructor() {

  }
}
